package com.zzxy.mvc.controller;

import com.zzxy.mvc.po.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/stu")
public class StuController {
    @RequestMapping("/add")
    public String add(){
        return "/user/register";
    }
    @RequestMapping("/register")
    public @ResponseBody Student register(@RequestBody Student student){
        System.out.println(student);
        student.setUsername(student.getUsername() + "34");
        student.setPassword(student.getPassword() + "34");
        return student;
    }
}
